<template>

    <el-main>
        <el-upload
                  class="upload-demo"
                  style="float: left;color: #fff;"
                  action="https://jsonplaceholder.typicode.com/posts/"
                  :on-preview="handlePreview"
                  :on-remove="handleRemove"
                  :before-remove="beforeRemove"
                  multiple
                  :limit="3"
                  :on-exceed="handleExceed"
                  :file-list="fileList"
                >
                  <el-button  type="text">稽查报告上传</el-button>

                </el-upload>
            <template>
              <!--aid: "231231212"
id: 1
iid: "1333213128048357397"
progress: 101
status: 1
task: "dashdkkl139012"-->
                <el-table
                :data="tableData">
                  <el-table-column
                    prop="id"
                    label="任务id"
                    width="180">
                  </el-table-column>
                  <el-table-column
                    prop="AID"
                    label="稽查管理员"
                    width="180">
                  </el-table-column>
                  <el-table-column
                    prop="IID"
                    label="稽查员id"
                    width="">
                  </el-table-column>
                  <el-table-column
                    prop="progress"
                    label="进度">
                  </el-table-column>
                  <el-table-column
                    prop="status"
                    label="状态">
                  </el-table-column>
                  <el-table-column
                    prop="task"
                    label="任务"
                    width="">
                  </el-table-column>
                </el-table>
            </template>

        </el-main>
</template>

<script>
    import cookies from "js-cookie";
    import axios from "axios";

    export default {
    data(){
      return {
        tableData: [],
      }
    },
      mounted() {
      this.getInfo()
      },
      methods: {
     data() {
      return {
        fileList: [{name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}, {name: 'food2.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}]
      };
    },
   async getInfo(){
     axios.post('/task-assign/get',{}).then((res)=>{
       console.log(res)
       this.tableData=res.data.data
     })
   },
    handleRemove(file, fileList) {
        console.log(file, fileList);
      },
      handlePreview(file) {
        console.log(file);
      },
      handleExceed(files, fileList) {
        this.$message.warning(`当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
      },
      beforeRemove(file, fileList) {
        //return this.$confirm(`确定移除 ${ file.name }？`);
        return this.$confirm(`关闭提示？`);
      },

    }
  }
</script>

<style>
</style>
